//
//  ZJQRCodeScanner.h
//  QRCoderWinthSystem
//
//  Created by quiet on 15/6/8.
//  Copyright (c) 2015年 zhang jian. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

@interface ZJQRCodeScanner : NSObject<AVCaptureMetadataOutputObjectsDelegate>
//定义捕获设备
@property (strong,nonatomic) AVCaptureDevice * device;

@property (strong,nonatomic) AVCaptureDeviceInput * input;

//定义捕获元数据输出对象
@property (strong,nonatomic) AVCaptureMetadataOutput * output;

//定义捕获会话对象(开始扫描,停止扫描)
@property (strong,nonatomic) AVCaptureSession * session;

//摄像头捕获前景视图
@property (strong,nonatomic) AVCaptureVideoPreviewLayer * previewLayer;

@property (nonatomic, retain) UIImageView * line;

//获取单例对象
+(instancetype)sharedInstance;

@property (copy,nonatomic) void (^result)(NSString *resultString);

//核心方法:扫描二维码
-(void)scanFromView:(UIView *)view result:(void (^)(NSString *resultString))result;

@end
